<base href="<?php echo base_url();?>" />
<link rel="stylesheet" href="assets/style.css" type="text/css" media="screen"/>

<table>
	<thead>
	    <tr>
	      <th>ID</th>
	      <th>Benutzername</th>
	      <th>Password</th>
	      <th>Admin</th>
	      <th>Lehrer</th>
	      <th>Bearbeiten</th>      
	    </tr>
  	</thead>
	<tbody >
		<?php foreach ($user as $row): ?>
	    <tr>
	        <td><?php echo $row['id'];?></td>
	        <td><?php echo $row['username'];?></td>
	        <td><?php echo $row['password'];?></td>
	        <td><?php echo $row['Admin'];?></td>
	        <td><?php echo $row['Lehrer'];?></td>
	        <td>
		        <?php $this->load->helper(array('form')); ?>
		    	<?php echo validation_errors(); ?>
				<?php echo form_open('user_controller/validate_view')?>
				<input type="input" name="userid" value=<?php echo $row['id'];?> hidden="true" />
	        	<input type='submit' name='submit' value='Ändern' > 	       
	        </td>
	 		</form>        
	    </tr>
		<?php endforeach; ?>
	</tbody>
</table>
<?php $this->load->helper(array('form')); ?>
<?php echo validation_errors(); ?>
<?php echo form_open('user_controller/create_view')?>
	<input type='submit' name='submit' value='Neuer User' > 
</form>

<!--    ######################################   -->

<?php
$this->load->helper(array('form'));
echo validation_errors(); 
echo form_open('kurseteilnehmer_controller/set_kurseteilnehmer');
echo "<input type='input' name='kursecode' hidden='true' value='".$kursecode."'/>";
echo "<table>
		<thead>
	    	<tr>
		      	<th>Teilnehmer. </th>
		      	<th>User ID </th>
	    	</tr>
		</thead>
		<tbody>";
			$a = 1;
			foreach($kurseteilnehmer as $row):
	  echo "<tr>
				<td>".$a." </td>
				<td>";
				echo "<input type='input' name='userid[".$a."]' value='".$row['UserID']."'/><br />";				
		   echo"</td>
			</tr>";
			$a++;
			endforeach;		
			for($i = $a; $i <= $Anzahl; $i++):
	  echo "<tr>
				<td>".$i." </td>
				<td>";
				echo "<input type='input' name='userid[".$i."]' /><br />";				
		   echo"</td>
			</tr>";
			endfor; 
 echo "</tbody>
	</table>";


echo "<input type='submit' name='submit' value='Teilnehmer Speichern' > <br /> <br />
	 </form>";

?>
